package api

import (
	"github.com/gogf/gf/net/ghttp"
	"shrimp-blog-server/app/model"
)

func (*apiResource) Get(request *ghttp.Request) {
	resourceService.GetResource(request, getQueryParamID(request)...)

}

func (*apiResource) Post(request *ghttp.Request) {
	var resources []model.Resource
	_ = request.Parse(&resources)
	resourceService.AddResource(request, resources...)
}

func (*apiResource) Put(request *ghttp.Request) {
	var resources []model.Resource
	_ = request.Parse(&resources)
	resourceService.UpdateResource(request, resources...)
}

func (*apiResource) Delete(request *ghttp.Request) {
	resourceService.DeleteResource(request, getQueryParamID(request)...)
}
